#ifndef RUNNABLE_H
#define RUNNABLE_H

#include <memory>

namespace sh
{
class RunnableData;
class Runnable
{
public:
    explicit Runnable();
    virtual ~Runnable();

    bool autoDelete() const;
    void setAutoDelete(bool autoDelete);

    /**
     * @brief   run()方法将会在线程中执行，需继承重写
     */
    virtual void run() = 0;
private:
    std::unique_ptr<sh::RunnableData> d;
};
}

#endif //RUNNABLE_H
